package cn.jiangxiong.pethome.system.dept.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.jiangxiong.pethome.base.domain.BaseDomain;
import cn.jiangxiong.pethome.system.user.domain.Employee;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Department extends BaseDomain {
    @ApiParam(name = "部门编号属性", required = true)
    @Excel(name = "部门编号" ,orderNum = "1", width = 30, isImportField = "true_st")
    private String sn;
    @ApiParam(name = "部门名称属性", required = true)
    @Excel(name = "部门名称" ,orderNum = "2", width = 30, isImportField = "true_st")
    private String name;
    @ApiParam(name = "dirPath属性", required = true)
    @Excel(name = "dirPath" ,orderNum = "3", width = 30, isImportField = "true_st")
    private String dirPath;
    @ApiParam(name = "启用属性", required = true)
    @Excel(name = "状态" ,orderNum = "4",replace = {"启用_1","未启用_0"}, width = 30, isImportField = "true_st")
    private Integer state;
    @ApiParam(name = "管理ID属性", required = true)
    @Excel(name = "管理ID" ,orderNum = "5", width = 30, isImportField = "true_st")
    private Long manager_id;
    @ApiParam(name = "上级ID属性", required = true)
    @Excel(name = "上级ID" ,orderNum = "6", width = 30, isImportField = "true_st")
    private Long parent_id;
    @ApiParam(name = "门店ID属性", required = true)
    @Excel(name = "门店ID" ,orderNum = "7", width = 30, isImportField = "true_st")
    private Long shop_id;


    //关联查询
    private Employee manager;
    private Department parent;

    //children 不能写错 因为element要使用
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList();
}
